<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Trim</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../css/default.css" rel="stylesheet" type="text/css">
</head>
<body>

<h1>Trim <span class="ver">[AHK_L 31+]</span></h1>

<p>移除字符串的开始和/或末尾的字符.</p>

<pre class="Syntax">Result :=  Trim(String, OmitChars = " `t")
Result := LTrim(String, OmitChars = " `t")
Result := RTrim(String, OmitChars = " `t")</pre>
<h3>参数</h3>
<table class="info">
  <tr>
    <td width="15%">String</td>
    <td width="85%">任何字符串值或变量. 不支持数字.</td>
  </tr>
  <tr>
    <td>OmitChars</td>
    <td>一个可选的从 <em>String</em> 的开始和/或末尾排除的字符列表 (区分大小写). 如果省略, 空格和 Tab 将被移除.</td>
  </tr>
</table>

<h3>示例</h3>
<pre class="NoIndent">text := "  text  "
MsgBox % "No trim:`t '" text "'"
    . "`nTrim:`t '" Trim(text) "'"
    . "`nLTrim:`t '" LTrim(text) "'"
    . "`nRTrim:`t '" RTrim(text) "'"
MsgBox % LTrim("00000123","0")</pre>

</body>
</html>
